-
Notifications
You must be signed in to change notification settings - Fork 4
/
hood customs enabled
200 lines (170 loc) · 5.64 KB
/
hood customs enabled
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
--.gg/locks runs you
--Made by sparkyz
getgenv().Prediction = 0.15038
getgenv().AimPart = "HumanoidRootPart"
getgenv().Key = "Q"
getgenv().DisableKey = "P"
getgenv().FOV = true
getgenv().ShowFOV = false
getgenv().FOVSize = 55
--// Variables (Service)
local Players = game:GetService("Players")
local RS = game:GetService("RunService")
local WS = game:GetService("Workspace")
local GS = game:GetService("GuiService")
local SG = game:GetService("StarterGui")
--// Variables (regular)
local LP = Players.LocalPlayer
local Mouse = LP:GetMouse()
local Camera = WS.CurrentCamera
local GetGuiInset = GS.GetGuiInset
local AimlockState = true
local Locked
local Victim
local SelectedKey = getgenv().Key
local SelectedDisableKey = getgenv().DisableKey
--// Notification function
function Notify(tx)
SG:SetCore("SendNotification", {
Title = "Cam Lock Enabled | .gg/locks",
Text = tx,
Duration = 5
})
end
--// Check if aimlock is loaded
if getgenv().Loaded == true then
Notify("Aimlock is already loaded!")
return
end
getgenv().Loaded = true
--// FOV Circle
local fov = Drawing.new("Circle")
fov.Filled = false
fov.Transparency = 1
fov.Thickness = 1
fov.Color = Color3.fromRGB(255, 255, 0)
fov.NumSides = 1000
--// Functions
function update()
if getgenv().FOV == true then
if fov then
fov.Radius = getgenv().FOVSize * 2
fov.Visible = getgenv().ShowFOV
fov.Position = Vector2.new(Mouse.X, Mouse.Y + GetGuiInset(GS).Y)
return fov
end
end
end
function WTVP(arg)
return Camera:WorldToViewportPoint(arg)
end
function WTSP(arg)
return Camera.WorldToScreenPoint(Camera, arg)
end
function getClosest()
local closestPlayer
local shortestDistance = math.huge
for i, v in pairs(game.Players:GetPlayers()) do
local notKO = v.Character:WaitForChild("BodyEffects")["K.O"].Value ~= true
local notGrabbed = v.Character:FindFirstChild("GRABBING_COINSTRAINT") == nil
if v ~= game.Players.LocalPlayer and v.Character and v.Character:FindFirstChild("Humanoid") and v.Character.Humanoid.Health ~= 0 and v.Character:FindFirstChild(getgenv().AimPart) and notKO and notGrabbed then
local pos = Camera:WorldToViewportPoint(v.Character.PrimaryPart.Position)
local magnitude = (Vector2.new(pos.X, pos.Y) - Vector2.new(Mouse.X, Mouse.Y)).magnitude
if (getgenv().FOV) then
if (fov.Radius > magnitude and magnitude < shortestDistance) then
closestPlayer = v
shortestDistance = magnitude
end
else
if (magnitude < shortestDistance) then
closestPlayer = v
shortestDistance = magnitude
end
end
end
end
return closestPlayer
end
--// Checks if key is down
Mouse.KeyDown:Connect(function(k)
SelectedKey = SelectedKey:lower()
SelectedDisableKey = SelectedDisableKey:lower()
if k == SelectedKey then
if AimlockState == true then
Locked = not Locked
if Locked then
Victim = getClosest()
Notify("Locked onto: "..tostring(Victim.Character.Humanoid.DisplayName))
else
if Victim ~= nil then
Victim = nil
Notify("Unlocked!")
end
end
else
Notify("Aimlock is not enabled!")
end
end
if k == SelectedDisableKey then
AimlockState = not AimlockState
end
end)
--// Loop update FOV and loop camera lock onto target
RS.RenderStepped:Connect(function()
update()
if AimlockState == true then
if Victim ~= nil then
Camera.CFrame = CFrame.new(Camera.CFrame.p, Victim.Character[getgenv().AimPart].Position + Victim.Character[getgenv().AimPart].Velocity*getgenv().Prediction)
end
end
end)
while wait() do
if getgenv().AutoPrediction == true then
local pingvalue = game:GetService("Stats").Network.ServerStatsItem["Data Ping"]:GetValueString()
local split = string.split(pingvalue,'(')
local ping = tonumber(split[1])
if ping < 225 then
getgenv().Prediction = 1.4
elseif ping < 215 then
getgenv().Prediction = 1.2
elseif ping < 205 then
getgenv().Prediction = 1.0
elseif ping < 190 then
getgenv().Prediction = 0.10
elseif ping < 180 then
getgenv().Prediction = 0.12
elseif ping < 170 then
getgenv().Prediction = 0.15
elseif ping < 160 then
getgenv().Prediction = 0.18
elseif ping < 150 then
getgenv().Prediction = 0.110
elseif ping < 140 then
getgenv().Prediction = 0.113
elseif ping < 130 then
getgenv().Prediction = 0.116
elseif ping < 120 then
getgenv().Prediction = 0.120
elseif ping < 110 then
getgenv().Prediction = 0.124
elseif ping < 105 then
getgenv().Prediction = 0.127
elseif ping < 90 then
getgenv().Prediction = 0.130
elseif ping < 80 then
getgenv().Prediction = 0.133
elseif ping < 70 then
getgenv().Prediction = 0.136
elseif ping < 60 then
getgenv().Prediction = 0.15038
elseif ping < 50 then
getgenv().Prediction = 0.15038
elseif ping < 40 then
getgenv().Prediction = 0.145
elseif ping < 30 then
getgenv().Prediction = 0.155
elseif ping < 20 then
getgenv().Prediction = 0.157
end
end
end